<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<h1>JavaScript Example </h1>
<br>
Creating objects using prototypes.
<br>
<hr>
<br>

<!-- SCRIPT STARTS HERE -->

<script type="text/javascript">

function Person(firstName,name) {
  this.firstName = firstName;
  this.name = name;
}

Person.prototype.fullName = function () {
  return this.firstName + " " + this.name;
};

var person1 = new Person("Jens","Dietrich");
var person2 = new Person("Giovanni","Moretti");

document.write(person1.fullName());
document.write("<p>");
document.write(person2.fullName());
</script>

</body>
</html>
